import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'
import DashboardView from '../views/DashboardView.vue'
import AmazonProductsView from '../views/AmazonProductsView.vue'
import SkuInventoryView from '../views/SkuInventoryView.vue'
import InventoryRecordsView from '../views/InventoryRecordsView.vue'
import InventoryWarningView from '../views/InventoryWarningView.vue'
import MobileProductListView from '../views/mobile/ProductListView.vue'
import MobileProductDetailView from '../views/mobile/ProductDetailView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/dashboard'
  },
  {
    path: '/dashboard',
    name: 'dashboard',
    component: DashboardView
  },
  {
    path: '/amazon-products',
    name: 'amazon-products',
    component: AmazonProductsView
  },
  {
    path: '/inventory/sku',
    name: 'sku-inventory',
    component: SkuInventoryView
  },
  {
    path: '/inventory/records',
    name: 'inventory-records',
    component: InventoryRecordsView
  },
  {
    path: '/inventory/warning',
    name: 'inventory-warning',
    component: InventoryWarningView
  },
  {
    path: '/mobile',
    name: 'mobile-home',
    component: MobileProductListView
  },
  {
    path: '/mobile/products/:id',
    name: 'mobile-product-detail',
    component: MobileProductDetailView
  },
  {
    path: '/inventory/warning-rules',
    name: 'WarningRules',
    component: () => import('../views/WarningRulesView.vue')
  },
  {
    path: '/purchase',
    name: 'PurchaseManage',
    component: () => import('../views/PurchaseManageView.vue')
  }
]

const router = new VueRouter({
  mode: 'hash',
  base: process.env.BASE_URL,
  routes
})

export default router 